|
|
|
@ -75,6 +75,7 @@ import java.util.NoSuchElementException; |
|
|
|
|
*/ |
|
|
|
|
@CheckReturnValue |
|
|
|
|
public abstract class ByteString implements Iterable<Byte>, Serializable { |
|
|
|
|
private static final long serialVersionUID = 1L; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* When two strings to be concatenated have a combined length shorter than this, we just copy |
|
|
|
@ -945,6 +946,8 @@ public abstract class ByteString implements Iterable<Byte>, Serializable { |
|
|
|
|
|
|
|
|
|
/** Base class for leaf {@link ByteString}s (i.e. non-ropes). */ |
|
|
|
|
abstract static class LeafByteString extends ByteString { |
|
|
|
|
private static final long serialVersionUID = 1L; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected final int getTreeDepth() { |
|
|
|
|
return 0; |
|
|
|
@ -1603,7 +1606,6 @@ public abstract class ByteString implements Iterable<Byte>, Serializable { |
|
|
|
|
// Keep this class private to avoid deadlocks in classloading across threads as ByteString's
|
|
|
|
|
// static initializer loads LiteralByteString and another thread loads BoundedByteString.
|
|
|
|
|
private static final class BoundedByteString extends LiteralByteString { |
|
|
|
|
|
|
|
|
|
private final int bytesOffset; |
|
|
|
|
private final int bytesLength; |
|
|
|
|
|
|
|
|
|