1. /*
  2. * @(#)Direct-X-Buffer.java 1.48 04/05/03
  3. *
  4. * Copyright 2004 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. import sun.misc.Cleaner;
  10. import sun.misc.Unsafe;
  11. import sun.nio.ch.DirectBuffer;
  12. import sun.nio.ch.FileChannelImpl;
  13. class DirectLongBufferRS
  14. extends DirectLongBufferS
  15. implements DirectBuffer
  16. {
  17. // For duplicates and slices
  18. //
  19. DirectLongBufferRS(DirectBuffer db, // package-private
  20. int mark, int pos, int lim, int cap,
  21. int off)
  22. {
  23. super(db, mark, pos, lim, cap, off);
  24. }
  25. public LongBuffer slice() {
  26. int pos = this.position();
  27. int lim = this.limit();
  28. assert (pos <= lim);
  29. int rem = (pos <= lim ? lim - pos : 0);
  30. int off = (pos << 3);
  31. assert (off >= 0);
  32. return new DirectLongBufferRS(this, -1, 0, rem, rem, off);
  33. }
  34. public LongBuffer duplicate() {
  35. return new DirectLongBufferRS(this,
  36. this.markValue(),
  37. this.position(),
  38. this.limit(),
  39. this.capacity(),
  40. 0);
  41. }
  42. public LongBuffer asReadOnlyBuffer() {
  43. return duplicate();
  44. }
  45. public LongBuffer put(long x) {
  46. throw new ReadOnlyBufferException();
  47. }
  48. public LongBuffer put(int i, long x) {
  49. throw new ReadOnlyBufferException();
  50. }
  51. public LongBuffer put(LongBuffer src) {
  52. throw new ReadOnlyBufferException();
  53. }
  54. public LongBuffer put(long[] src, int offset, int length) {
  55. throw new ReadOnlyBufferException();
  56. }
  57. public LongBuffer compact() {
  58. throw new ReadOnlyBufferException();
  59. }
  60. public boolean isDirect() {
  61. return true;
  62. }
  63. public boolean isReadOnly() {
  64. return true;
  65. }
  66. public ByteOrder order() {
  67. return ((ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN)
  68. ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN);
  69. }
  70. }