1. /*
  2. * @(#)ByteBufferAs-X-Buffer.java 1.14 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. // -- This file was mechanically generated: Do not edit! -- //
  8. package java.nio;
  9. class ByteBufferAsShortBufferRB // package-private
  10. extends ByteBufferAsShortBufferB
  11. {
  12. ByteBufferAsShortBufferRB(ByteBuffer bb) { // package-private
  13. super(bb);
  14. }
  15. ByteBufferAsShortBufferRB(ByteBuffer bb,
  16. int mark, int pos, int lim, int cap,
  17. int off)
  18. {
  19. super(bb, mark, pos, lim, cap, off);
  20. }
  21. public ShortBuffer slice() {
  22. int pos = this.position();
  23. int lim = this.limit();
  24. assert (pos <= lim);
  25. int rem = (pos <= lim ? lim - pos : 0);
  26. int off = (pos << 1) + offset;
  27. return new ByteBufferAsShortBufferRB(bb, -1, 0, rem, rem, off);
  28. }
  29. public ShortBuffer duplicate() {
  30. return new ByteBufferAsShortBufferRB(bb,
  31. this.markValue(),
  32. this.position(),
  33. this.limit(),
  34. this.capacity(),
  35. offset);
  36. }
  37. public ShortBuffer asReadOnlyBuffer() {
  38. return duplicate();
  39. }
  40. public ShortBuffer put(short x) {
  41. throw new ReadOnlyBufferException();
  42. }
  43. public ShortBuffer put(int i, short x) {
  44. throw new ReadOnlyBufferException();
  45. }
  46. public ShortBuffer compact() {
  47. throw new ReadOnlyBufferException();
  48. }
  49. public boolean isDirect() {
  50. return bb.isDirect();
  51. }
  52. public boolean isReadOnly() {
  53. return true;
  54. }
  55. public ByteOrder order() {
  56. return ByteOrder.BIG_ENDIAN;
  57. }
  58. }