summaryrefslogtreecommitdiff
path: root/gnu/javax/net/ssl/provider/UnresolvedExtensionValue.java
blob: 720249e855b73fce431852d8a5b3a4e098324366 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package gnu.javax.net.ssl.provider;

import gnu.javax.net.ssl.provider.Extension.Value;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.nio.ByteBuffer;

public class UnresolvedExtensionValue extends Value
{
  private final ByteBuffer buffer;
  
  public UnresolvedExtensionValue (final ByteBuffer buffer)
  {
    this.buffer = buffer;
  }
  
  public int length()
  {
    return buffer.limit();
  }
  
  public ByteBuffer value()
  {
    return buffer.slice();
  }
  
  public String toString()
  {
    return toString(null);
  }
  
  public String toString(final String prefix)
  {
    String s = Util.hexDump(buffer);
    if (prefix != null)
      s = prefix + s;
    return s;
  }
}